package com.supergdtop.www.run.tools;

import java.util.Random;

/**
 * 验证码生成工具
 * Created by Asum on 2016/7/14 0014.
 */
public class AuthCodeTools {
    public static String getAuthCode() {
        Random r = new Random();
        int code = r.nextInt(9999);

        if (code < 10) {
            return "000" + code;
        } else if (code < 100) {
            return "00" + code;
        } else if (code < 1000) {
            return "0" + code;
        } else {
            return "" + code;
        }
    }
}
